package com.puman.hello;

import com.puman.helloserviceapi.model.User;
import com.puman.helloserviceapi.service.HelloService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RefactorHelloController implements HelloService {


    @Override
    public String hello(@RequestParam("name") String name) {
        return "hello"+name+"*******";
    }

    @Override
    public User hello(@RequestHeader("name") String name,@RequestHeader("id") long id) {
        return new User(name,id);
    }

    @Override
    public String hello(@RequestBody User user) {
        return "hello"+user.getName()+","+user.getId();
    }
}
